from datetime import datetime, date


def warp_date_field(data):
    for item in data:
        for k, v in item.items():
            if isinstance(v, date):
                item[k] = v.strftime("%Y-%m-%d")
            if isinstance(v, datetime):
                item[k] = v.strftime("%Y-%m-%d %H:%M:%S")
    return data


def parse_date(date_string):
    """
    将日期字符串解析为date对象
    """
    return datetime.strptime(date_string, '%Y-%m-%d').date()


def parse_time(time_string):
    """
    将时间字符串解析为time对象
    """
    return datetime.strptime(time_string, '%H:%M:%S').time()
